//
//  main.m
//  clase
//
//  Created by mac on 16-4-12.
//  Copyright (c) 2016年 ZF. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Animo.h"
#import "Person.h"
#import "Student.h"
#import "Teacher.h"
int main(int argc, const char * argv[])
{

    @autoreleasepool {
        Animo *ani=[[Animo alloc] init];//alloc 分配内存 init 初始化继承根对象
        ani.name = @"dog";
       
        Person *p=[[Person alloc] init];
        p.name = @"xiaoming";
        
        NSArray *arr =@[ani.name,p.name];
        NSLog(@"names: %@", [arr componentsJoinedByString:@","]);//componentsJoinedByString:@" "连接字符串

        NSArray *numbers =@[@(5), @(3), @(4)];
        numbers = [numbers sortedArrayUsingSelector:@selector(compare:)];//sortedArrayUsingSelecto:selector自动排序
       
        for(int i=0;i<numbers.count;i++)
        {
            NSLog(@"%@",numbers[i]);
        }
        
        Student *student = [[Student alloc] init];
        Teacher *teacher = [[Teacher alloc] init];
        teacher.delegate = student;
        [teacher CheckHomework];
    }
    return 0;
}

